package com.linkhub.oms.dao.mpservice.impl;

import com.linkhub.oms.entity.PreemptionStockFlowEntity;
import com.linkhub.oms.dao.mapper.PreemptionStockFlowEntityMapper;
import com.linkhub.oms.dao.mpservice.IPreemptionStockFlowService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 预占库存流水表 服务实现类
 * </p>
 *
 * @author xieyu
 * @since 2024-06-20
 */
@Service
public class PreemptionStockFlowServiceImpl extends ServiceImpl<PreemptionStockFlowEntityMapper, PreemptionStockFlowEntity> implements IPreemptionStockFlowService {

    @Override
    public List<PreemptionStockFlowEntity> list(String userId, String stashName,
                                                String skuId, String businessType, String businessNo) {
        return lambdaQuery()
                .eq(PreemptionStockFlowEntity::getSkuId, skuId)
                .eq(PreemptionStockFlowEntity::getUserId, userId)
                .eq(PreemptionStockFlowEntity::getStashName, stashName)
                .eq(PreemptionStockFlowEntity::getBusinessType, businessType)
                .eq(PreemptionStockFlowEntity::getBusinessNo, businessNo)
                .list();
    }


    @Override
    public List<PreemptionStockFlowEntity> list(String userId, String stashName, String skuId, String businessNo) {
        return lambdaQuery()
                .eq(PreemptionStockFlowEntity::getSkuId, skuId)
                .eq(PreemptionStockFlowEntity::getUserId, userId)
                .eq(PreemptionStockFlowEntity::getStashName, stashName)
                .eq(PreemptionStockFlowEntity::getBusinessNo, businessNo)
                .list();
    }
}
